package com.czl.module_storehouse.mvp.model;

import com.czl.base.data.net.RetrofitClient;
import com.czl.module_base.bean.ListBean;
import com.czl.module_base.http.HttpResponse;
import com.czl.module_storehouse.api.ApiService;
import com.czl.module_storehouse.bean.StorageRecordBean;

import org.json.JSONObject;

import io.reactivex.Observable;

/**
 * @author by xubin,
 * @date on 2022/3/3.
 * PS: Not easy to write code, please indicate.
 */
public class WarehouseRecordModel extends BasicDataModel {
    public Observable<HttpResponse<ListBean<StorageRecordBean>>> getStorageList(int pageNo) {
        JSONObject object = new JSONObject();
        try {
            object.put("storehouseId", getStorehouseId());
            object.put("pageNo", pageNo);
            object.put("pageSize", 10);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return RetrofitClient.getInstance().create(ApiService.class).getStorageList(createBody(object));
    }
}
